<div class="featureBox">
    <div class="container">
        <div class="row">
            <div class="span12">            	
                <ul class="breadcrumb">
                    <li class="previous"><a href="<?php echo SITE_URL; ?>">Home /</a></li>
                    <li class="previous"><?php echo CHtml::link($classCoursename, $this->createAbsoluteUrl($action, array('id' => $classes->id))); ?> / </li>
                    <li class="disable"><a href="javascript:void(0)"><?php echo $profiles->first_name . ' ' . $profiles->last_name; ?></a></li>
                </ul>                    
            </div>
            <div class="span6"> 
                <!--Trainer Image Section-->           	
                <div class="featureImg">                            
                    <img src="<?php
echo baseUrl() . '../../' . getUploadDir();
echo ($profiles->photo != '') ? $imagePath . '/profile/432X324/' . $profiles->photo : 'default-mini.png';
?>">	     
                </div>
                <!--End Trainer Image Section-->
            </div>
            <div class="span6">
                <!--Trainer Detail Section-->
                <div class="detailBox">            		
                    <h4 class="txt676 fnt-size20 lineH20px addpaddingB5"><?php echo $profiles->first_name . '  ' . $profiles->last_name; ?></h4>
                    <div class="height1px borBgren addmarginB14"></div>
                    <p class="fnt-size18 addmarginB15"><span class="txtgreen font-opensansbd">Member since</span> <?php echo date('d M Y', $profiles->user->createtime); ?></p>
                    <div class="height1px borBgren addmarginB14"></div>
                    <ul class="trainerSocial">

                        <li><a href="<?php echo ($userType != 'backend') ? $profiles->facebook : FACEBOOK_LINK; ?>" class="social-sprite fb-icon" title="Facebook Link" target="_blank">facebook</a></li>
                        <li><a href="<?php echo ($userType != 'backend') ? $profiles->twitter : TWITTER_LINK; ?>" class="social-sprite twitter-icon" title="Twitter Link" target="_blank">twitter</a></li>
                        <li><a href="<?php echo ($userType != 'backend') ? $profiles->linkedin : LINKEDIN_LINK; ?>" class="social-sprite linkd-icon" title="Linkden Link" target="_blank">share</a></li>     
                    </ul>
                    <div class="height1px borBgren addmarginB14"></div>                     
                    <a href="javascript:void(0);" class="btn-orange" id="submitLbtR" onclick="followTrainner(<?php echo $classes->id; ?>,<?php echo "'$classtype'" ?>)"><?php echo $folowers; ?></a>
                    <div id="ajaxLoderClass" style="margin: 0 auto;float: right;width: 50%;display: none;"><img src="<?php echo ThemePath(); ?>/images/AjaxLoader.gif"></img></div><div id="error_reviews_text_trainer" class="errorMessage"></div></div>
                <!--End Trainer Detail Section-->
            </div>
        </div>
    </div>
</div>
<section class="contentCntr whiteBg noRadius">
    <div class="container">
        <div class="row">
            <div class="span12"> 
                <!--Content Area-->
                <div class="descriptionArea">           	
                    <ul class="nav nav-tabs" id="myTab">
                        <li class="active"><a href="#aboutus" data-toggle="tab">About Us</a></li>
                        <li><a href="#experience" data-toggle="tab">Experience</a></li>
                        <li><a href="#otherinformation" data-toggle="tab">Other Information</a></li>
                    </ul>
                    <div id="contentBox" class="tab-content">
                        <div class="tab-pane active" id="aboutus">
                            <?php echo $profiles->about; ?>
                        </div>
                        <div class="tab-pane" id="experience">
                            <?php echo $profiles->experience; ?>
                        </div>
                        <div class="tab-pane" id="otherinformation">
                            <?php echo $profiles->other_info; ?>

                        </div>
                    </div>				
                </div>    
                <!--End Of Content Area-->    
            </div>                        
        </div>
    </div>    
</section>

<section class="contentCntr">
    <div class="container">
        <div class="row">
            <div class="span5">
                <!--Review Box-->
                <div class="reviewBox">  
                    <div id="reviewDiv">              	
                        <h4 class="txttTransformNorml addpaddingB20">Reviews<span class="rbutton"> <a class="carousel-control left" href="#reviewCarousel" data-slide="prev"><img src="<?php echo ThemePath(); ?>/images/slide-left.png" /></a><a class="carousel-control right" href="#reviewCarousel" data-slide="next"><img src="<?php echo ThemePath(); ?>/images/slide-right.png" /></a></span></h4>
                        <?php /* ---------render page reviewpage for view all  review start ---------------- */ ?>
                        <?php $this->renderPartial('/trainerProfileReview/_viewReview', array('profiles' => $profiles, 'userType' => $userType)); ?>
                        <?php /* ---------render page reviewpage end---------------- */ ?>

                    </div>
                    <div id="reviewEntryBox" style="display:none;">
                        <h4 class="txttTransformNorml">Add Review</h4>
                        <form>
                            <fieldset>
                                <?php /* ---------render page reviewpage for write review start ---------------- */ ?>
                                <?php $this->renderPartial('/trainerProfileReview/_form', array('profiles' => $profiles, 'userType' => $userType)); ?>
                                <?php /* ---------render page reviewpage end---------------- */ ?>
                            </fieldset>
                        </form>
                    </div>
                </div>
                <!--End of Review Box-->    
            </div>
            <div class="span7">
                <!--Recommend Box-->
                <h4 class="font-opensanslt txt000 fnt-size26 remmarginT txttTransformNorml addpaddingB10 fntweghtNml">Reviews and Recommendations</h4>
                <div class="recommendBox-inner">
                    <div class="contents">
                        <div class="floatL">
                            <h4><?php echo (!empty($classtotalCountTrainerate)) ? $classtotalCountTrainerate . '<br>Recommendations' : 'No Recommendations'; ?></h4>
                            <p class="padding10px font-opensansilt fnt-size20 whiteBg inline-block noRadius"><?php echo (!empty($classTrainerRate)) ? $classTrainerRate . '% Positive' : '0% Positive'; ?></p>
                        </div>
                        <img class="floatR" src="<?php echo ThemePath(); ?>/images/recomend-hand.png" />
                    </div>

                </div>
                <!--End of Recommend Box-->
            </div>
        </div>
    </div>
</section>

<?php
$runningClasses = array();
$classDetails = literalEndingTommorow($profiles, $userType, '');
$courseDetails = runningCurrentCoursesByUser($profiles, $userType, ''); //Null parameter means these value $profiles, $userType, $getValue)
$runningClasses = array_merge($classDetails, $courseDetails);
usort($runningClasses, 'date_compare');

if (!empty($runningClasses)) {
    $this->renderPartial('/classes/_runningClassCourseByUser', array('runningClasses' => $runningClasses, 'authKey' => $authKey));
} else {
    $allClassCourseInfo = array();
    $classDetails = literalEndingTommorow('', '', '');
    $courseDetails = runningCurrentCoursesByUser('', '', ''); //Null parameter means these value $profiles, $userType, $getValue)
    $allClassCourseInfo = array_merge($classDetails, $courseDetails);
    usort($allClassCourseInfo, 'date_compare');
    $validatedata = literalendingtommorowValiadte($allClassCourseInfo);
    if (!empty($validatedata)) {
        $this->renderPartial('/classes/literallyEndingtomorrow', array('allClassCourseInfo' => $allClassCourseInfo));
    }
}
?>


<?php /* previousClassCourseByuser */ ?>
<?php
$priviousClasses = previousClassCourseByuser($profiles, $userType);
if (!empty($priviousClasses)) {
    $this->renderPartial('/classes/_previouslytaughtClassesCourses', array('priviousClasses' => $priviousClasses, 'authKey' => $authKey));
}
?>

<?php /* code for slider People who liked this Literally Ending tomorrow */ ?>
<?php
$likeClassCourse = peoplelikedClassCourse();
if (!empty($likeClassCourse)) {
    $this->renderPartial('/classes/_likeClassCourse');
}
?>

<script type="text/javascript" src="<?php echo ThemePath(); ?>/js/jquery.nicescroll.js"></script>
<script>
    $("#writeRbtn").click(function() {
        $("#reviewDiv").hide();
        $("#reviewEntryBox").show();
        return false;
    });
    $("#cancelRbtn").click(function() {
        $("#reviewEntryBox").hide();
        $("#reviewDiv").show();
        return false;
    });
    $("#addNewReview").click(function() {
        $("#reviewDiv").hide();
        $("#reviewEntryBox").show();
        return false;
    });
    
    function followTrainner(class_id,type){ 
        $("#ajaxLoderClass").show();
        $.post("<?php echo Yii::app()->createUrl("TrainerFollow/followTrainner"); ?>", {'class_id':class_id,'type':type}, function(result) {
            $("#ajaxLoderClass").hide();
            if ($.trim(result) == 'redirect') {
                openLoginReview();
                return false;}
            if ($.trim(result) == 'Fail') {                   
                $("#error_reviews_text_trainer").text("You can't follow own.");
                return false;
            }
            if($.trim(result) == 'againsameuser') {                 
                $("#error_reviews_text_trainer").text("You you have already follow  <?php echo $profiles->first_name . ' ' . $profiles->last_name; ?>. trainer").show();
                return false;
            }
            if($.trim(result) == 'Success') {  
                $('#submitLbtR').text(<?php echo "'" . Message::FOLOWER_ON_SKILLHIPPO . "'"; ?>);               
                $("#error_reviews_text_trainer").text("Now you have follow this trainer name   <?php echo $profiles->first_name . ' ' . $profiles->last_name; ?>. trainer").show();
                return false;
            }
        });
    }
        
 
</script>

<!--Login Form Popup-->
<div id="loginPopReview" class="pop-out mfp-hide">
    <?php
    Yii::app()->getModule('user');
    $this->renderPartial('application.modules.user.views.user.loginpopgeneral');
    ?>
</div>
<!--End Login Form Popup-->
